<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="keywords" content="">
  <meta name="description" content="">
  <title>选择角色</title>
  <link href="/static/css/bootstrap.min.css" rel="stylesheet"/>
  <link rel="stylesheet" href="/static/include/css/style.css">
</head>
<body class="gray-bg">
<div class="container-div">
  <div class="row">
    <!--            <div class="col-sm-12 search-collapse">-->
    <!--                <form id="formId">-->
    <!--                    <div class="select-list">-->
    <!--                        <ul>-->
    <!--                            <li>-->
    <!--                                <label>消息类型：</label>-->
    <!--                                <select name="msgType" th:with="type=${@dict.getType('message_type')}">-->
    <!--                                    <option value="">所有</option>-->
    <!--                                    <option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}"></option>-->
    <!--                                </select>-->
    <!--                            </li>-->
    <!--                            <li>-->
    <!--                                <label>消息标题：</label>-->
    <!--                                <input type="text" name="msgTitle"/>-->
    <!--                            </li>-->
    <!--                            <li>-->
    <!--                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>-->
    <!--                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>-->
    <!--                            </li>-->
    <!--                        </ul>-->
    <!--                    </div>-->
    <!--                </form>-->
    <!--            </div>-->
    <div class="col-sm-12 select-table table-striped">
      <table id="bootstrap-table"></table>
    </div>
  </div>
</div>
<script src="/static/include/js/footer.js"></script>
<script>
  var roleIds;

  function initData(initData) {
    roleIds = initData
    initTable()
  }

  function initTable() {
    var options = {
      url: api + '/admin/role/page',
      columns: [{
        checkbox: true,
        formatter: function (value, row, index) {
          if (roleIds.indexOf(row.roleId) >= 0) {
            return {
              checked: true
            }
          }
        }
      },
        {
          field: 'roleName',
          title: '角色名称'
        },
        {
          field: 'roleCode',
          title: '角色标识'
        }]
    };
    $.table.init(options);
  }
</script>

</body>
</html>